This function returns a list of all existing consoles.
- Function: console-device-list &optional CONSOLE
This function returns a list of all devices on CONSOLE. If
CONSOLE is `nil', the selected console will be used.
File: lispref.info, Node: Basic Device Functions, Next: Console Types and Device Classes, Prev: Basic Console Functions, Up: Consoles and Devices
Basic Device Functions
======================
- Function: device-list
This function returns a list of all existing devices.
- Function: device-or-frame-p OBJECT
This function returns non-`nil' if OBJECT is a device or frame.
This function is useful because devices and frames are similar in
many respects and many functions can operate on either one.
- Function: device-frame-list DEVICE
This function returns a list of all frames on DEVICE.
- Function: frame-device FRAME
This function returns the device that FRAME is on.
File: lispref.info, Node: Console Types and Device Classes, Next: Connecting to a Console or Device, Prev: Basic Device Functions, Up: Consoles and Devices
Console Types and Device Classes
================================
Every device is of a particular "type", which describes how the
connection to that device is made and how the device operates, and a
particular "class", which describes other characteristics of the device
(currently, the color capabilities of the device).
The currently-defined device types are
`x'
A connection to an X display (such as `willow:0').
`tty'
A connection to a tty (such as `/dev/ttyp3').
`stream'
A stdio connection. This describes a device for which input and
output is only possible in a stream-like fashion, such as when
XEmacs in running in batch mode. The very first device created by
XEmacs is a terminal device and is used to print out messages of
various sorts (for example, the help message when you use the
`-help' command-line option).
The currently-defined device classes are
`color'
A color device.
`grayscale'
A grayscale device (a device that can display multiple shades of
gray, but no color).
`mono'
A device that can only display two colors (e.g. black and white).
- Function: device-type DEVICE
This function returns the type of DEVICE. This is a symbol whose
name is one of the device types mentioned above.
- Function: device-or-frame-type DEVICE-OR-FRAME
This function returns the type of DEVICE-OR-FRAME.
- Function: device-class DEVICE
This function returns the class (color behavior) of DEVICE. This
is a symbol whose name is one of the device classes mentioned
above.
- Function: valid-device-type-p DEVICE-TYPE
This function returns whether DEVICE-TYPE (which should be a
symbol) species a valid device type.
- Function: valid-device-class-p DEVICE-CLASS
This function returns whether DEVICE-CLASS (which should be a
symbol) species a valid device class.
- Variable: terminal-device
This variable holds the initial terminal device object, which
represents XEmacs's stdout.
File: lispref.info, Node: Connecting to a Console or Device, Next: The Selected Console and Device, Prev: Console Types and Device Classes, Up: Consoles and Devices
Connecting to a Console or Device
=================================
- Function: make-device &optional TYPE DEVICE-DATA
This function creates a new device.
The following two functions create devices of specific types and are
This function creates a new device connected to DISPLAY. Optional
argument ARGV-LIST is a list of strings describing command line
options.
- Function: delete-device DEVICE
This function deletes DEVICE, permanently eliminating it from use.
This disconnects XEmacs's connection to the device.
- Variable: create-device-hook
This variable, if non-`nil', should contain a list of functions,
which are called when a device is created.
- Variable: delete-device-hook
This variable, if non-`nil', should contain a list of functions,
which are called when a device is deleted.
- Function: console-live-p OBJECT
This function returns non-`nil' if OBJECT is a console that has
not been deleted.
- Function: device-live-p OBJECT
This function returns non-`nil' if OBJECT is a device that has not
been deleted.
- Function: device-x-display DEVICE
This function returns the X display which DEVICE is connected to,
if DEVICE is an X device.
File: lispref.info, Node: The Selected Console and Device, Next: Console and Device I/O, Prev: Connecting to a Console or Device, Up: Consoles and Devices
The Selected Console and Device
===============================
- Function: select-console CONSOLE
This function selects the console CONSOLE. Subsequent editing
commands apply to its selected device, selected frame, and selected
window. The selection of CONSOLE lasts until the next time the
user does something to select a different console, or until the
next time this function is called.
- Function: selected-console
This function returns the console which is currently active.
- Function: select-device DEVICE
This function selects the device DEVICE.
- Function: selected-device &optional CONSOLE
This function returns the device which is currently active. If
optional CONSOLE is non-`nil', this function returns the device
that would be currently active if CONSOLE were the selected
console.
File: lispref.info, Node: Console and Device I/O, Prev: The Selected Console and Device, Up: Consoles and Devices
Console and Device I/O
======================
- Function: console-disable-input CONSOLE
This function disables input on console CONSOLE.
- Function: console-enable-input CONSOLE
This function enables input on console CONSOLE.
Each device has a "baud rate" value associated with it. On most
systems, changing this value will affect the amount of padding and
other strategic decisions made during redisplay.
- Function: device-baud-rate &optional DEVICE
This function returns the output baud rate of DEVICE.
- Function: set-device-baud-rate DEVICE RATE
This function sets the output baud rate of DEVICE to RATE.
File: lispref.info, Node: Positions, Next: Markers, Prev: Consoles and Devices, Up: Top
Positions
*********
A "position" is the index of a character in the text of a buffer.
More precisely, a position identifies the place between two characters
(or before the first character, or after the last character), so we can
speak of the character before or after a given position. However, we
often speak of the character "at" a position, meaning the character
after that position.
Positions are usually represented as integers starting from 1, but
can also be represented as "markers"--special objects that relocate
automatically when text is inserted or deleted so they stay with the
surrounding characters. *Note Markers::.
* Menu:
* Point:: The special position where editing takes place.
* Motion:: Changing point.
* Excursions:: Temporary motion and buffer changes.
* Narrowing:: Restricting editing to a portion of the buffer.
File: lispref.info, Node: Point, Next: Motion, Up: Positions
Point
=====
"Point" is a special buffer position used by many editing commands,
including the self-inserting typed characters and text insertion
functions. Other commands move point through the text to allow editing
and insertion at different places.
Like other positions, point designates a place between two characters
(or before the first character, or after the last character), rather
than a particular character. Usually terminals display the cursor over
the character that immediately follows point; point is actually before
the character on which the cursor sits.
The value of point is a number between 1 and the buffer size plus 1.
If narrowing is in effect (*note Narrowing::.), then point is
constrained to fall within the accessible portion of the buffer
(possibly at one end of it).
Each buffer has its own value of point, which is independent of the
value of point in other buffers. Each window also has a value of point,
which is independent of the value of point in other windows on the same
buffer. This is why point can have different values in various windows
that display the same buffer. When a buffer appears in only one window,
the buffer's point and the window's point normally have the same value,
so the distinction is rarely important. *Note Window Point::, for more
details.
- Function: point &optional BUFFER
This function returns the value of point in BUFFER, as an integer.
BUFFER defaults to the current buffer if omitted.
(point)
=> 175
- Function: point-min &optional BUFFER
This function returns the minimum accessible value of point in
BUFFER. This is normally 1, but if narrowing is in effect, it is
the position of the start of the region that you narrowed to.
(*Note Narrowing::.) BUFFER defaults to the current buffer if
omitted.
- Function: point-max &optional BUFFER
This function returns the maximum accessible value of point in
BUFFER. This is `(1+ (buffer-size buffer))', unless narrowing is
in effect, in which case it is the position of the end of the
region that you narrowed to. (*Note Narrowing::). BUFFER defaults
to the current buffer if omitted.
- Function: buffer-end FLAG &optional BUFFER
This function returns `(point-min buffer)' if FLAG is less than 1,
`(point-max buffer)' otherwise. The argument FLAG must be a
number. BUFFER defaults to the current buffer if omitted.
- Function: buffer-size &optional BUFFER
This function returns the total number of characters in BUFFER.
In the absence of any narrowing (*note Narrowing::.), `point-max'
returns a value one larger than this. BUFFER defaults to the
current buffer if omitted.
(buffer-size)
=> 35
(point-max)
=> 36
- Variable: buffer-saved-size
The value of this buffer-local variable is the former length of the
current buffer, as of the last time it was read in, saved or
auto-saved.
File: lispref.info, Node: Motion, Next: Excursions, Prev: Point, Up: Positions
Motion
======
Motion functions change the value of point, either relative to the
current value of point, relative to the beginning or end of the buffer,
or relative to the edges of the selected window. *Note Point::.
* Menu:
* Character Motion:: Moving in terms of characters.
* Word Motion:: Moving in terms of words.
* Buffer End Motion:: Moving to the beginning or end of the buffer.
* Text Lines:: Moving in terms of lines of text.
* Screen Lines:: Moving in terms of lines as displayed.
* List Motion:: Moving by parsing lists and sexps.
* Skipping Characters:: Skipping characters belonging to a certain set.
File: lispref.info, Node: Character Motion, Next: Word Motion, Up: Motion
Motion by Characters
--------------------
These functions move point based on a count of characters.
`goto-char' is the fundamental primitive; the other functions use that.
- Command: goto-char POSITION &optional BUFFER
This function sets point in `buffer' to the value POSITION. If
POSITION is less than 1, it moves point to the beginning of the
buffer. If POSITION is greater than the length of the buffer, it
moves point to the end. BUFFER defaults to the current buffer if
omitted.
If narrowing is in effect, POSITION still counts from the
beginning of the buffer, but point cannot go outside the accessible
portion. If POSITION is out of range, `goto-char' moves point to
the beginning or the end of the accessible portion.
When this function is called interactively, POSITION is the
numeric prefix argument, if provided; otherwise it is read from the
minibuffer.
`goto-char' returns POSITION.
- Command: forward-char &optional COUNT BUFFER
This function moves point COUNT characters forward, towards the
end of the buffer (or backward, towards the beginning of the
buffer, if COUNT is negative). If the function attempts to move
point past the beginning or end of the buffer (or the limits of
the accessible portion, when narrowing is in effect), an error is
signaled with error code `beginning-of-buffer' or `end-of-buffer'.
BUFFER defaults to the current buffer if omitted.
In an interactive call, COUNT is the numeric prefix argument.
- Command: backward-char &optional COUNT BUFFER
This function moves point COUNT characters backward, towards the
beginning of the buffer (or forward, towards the end of the
buffer, if COUNT is negative). If the function attempts to move
point past the beginning or end of the buffer (or the limits of
the accessible portion, when narrowing is in effect), an error is
signaled with error code `beginning-of-buffer' or `end-of-buffer'.
BUFFER defaults to the current buffer if omitted.
In an interactive call, COUNT is the numeric prefix argument.
File: lispref.info, Node: Word Motion, Next: Buffer End Motion, Prev: Character Motion, Up: Motion
Motion by Words
---------------
These functions for parsing words use the syntax table to decide
whether a given character is part of a word. *Note Syntax Tables::.
- Command: forward-word COUNT &optional BUFFER
This function moves point forward COUNT words (or backward if
COUNT is negative). Normally it returns `t'. If this motion
encounters the beginning or end of the buffer, or the limits of the
accessible portion when narrowing is in effect, point stops there
and the value is `nil'. BUFFER defaults to the current buffer if
omitted.
In an interactive call, COUNT is set to the numeric prefix
argument.
- Command: backward-word COUNT &optional BUFFER
This function is just like `forward-word', except that it moves
backward until encountering the front of a word, rather than
forward. BUFFER defaults to the current buffer if omitted.
In an interactive call, COUNT is set to the numeric prefix
argument.
This function is rarely used in programs, as it is more efficient
to call `forward-word' with a negative argument.
- Variable: words-include-escapes
This variable affects the behavior of `forward-word' and everything
that uses it. If it is non-`nil', then characters in the "escape"
and "character quote" syntax classes count as part of words.
Otherwise, they do not.
File: lispref.info, Node: Buffer End Motion, Next: Text Lines, Prev: Word Motion, Up: Motion
Motion to an End of the Buffer
------------------------------
To move point to the beginning of the buffer, write:
(goto-char (point-min))
Likewise, to move to the end of the buffer, use:
(goto-char (point-max))
Here are two commands that users use to do these things. They are
documented here to warn you not to use them in Lisp programs, because
they set the mark and display messages in the echo area.
- Command: beginning-of-buffer &optional N
This function moves point to the beginning of the buffer (or the
limits of the accessible portion, when narrowing is in effect),
setting the mark at the previous position. If N is non-`nil',
then it puts point N tenths of the way from the beginning of the
buffer.
In an interactive call, N is the numeric prefix argument, if
provided; otherwise N defaults to `nil'.
Don't use this function in Lisp programs!
- Command: end-of-buffer &optional N
This function moves point to the end of the buffer (or the limits
of the accessible portion, when narrowing is in effect), setting
the mark at the previous position. If N is non-`nil', then it puts
point N tenths of the way from the end of the buffer.
In an interactive call, N is the numeric prefix argument, if
provided; otherwise N defaults to `nil'.
Don't use this function in Lisp programs!
File: lispref.info, Node: Text Lines, Next: Screen Lines, Prev: Buffer End Motion, Up: Motion
Motion by Text Lines
--------------------
Text lines are portions of the buffer delimited by newline
characters, which are regarded as part of the previous line. The first
text line begins at the beginning of the buffer, and the last text line
ends at the end of the buffer whether or not the last character is a
newline. The division of the buffer into text lines is not affected by
the width of the window, by line continuation in display, or by how
tabs and control characters are displayed.
- Command: goto-line LINE
This function moves point to the front of the LINEth line,
counting from line 1 at beginning of the buffer. If LINE is less
than 1, it moves point to the beginning of the buffer. If LINE is
greater than the number of lines in the buffer, it moves point to
the end of the buffer--that is, the *end of the last line* of the
buffer. This is the only case in which `goto-line' does not
necessarily move to the beginning of a line.
If narrowing is in effect, then LINE still counts from the
beginning of the buffer, but point cannot go outside the accessible
portion. So `goto-line' moves point to the beginning or end of the
accessible portion, if the line number specifies an inaccessible
position.
The return value of `goto-line' is the difference between LINE and
the line number of the line to which point actually was able to
move (in the full buffer, before taking account of narrowing).
Thus, the value is positive if the scan encounters the real end of
the buffer. The value is zero if scan encounters the end of the
accessible portion but not the real end of the buffer.
In an interactive call, LINE is the numeric prefix argument if one
has been provided. Otherwise LINE is read in the minibuffer.